#pragma once
#include <istream>
#include <string>
#include <sys/types.h>
#include <sys/socket.h>


// 描述 退出码
enum ExitCode
{
    // 使用，sock，本地网络bind，listen状态，connect链接
    OK = 0,
    USAGE_ERR,
    SOCKET_ERR,
    BIND_ERR,
    LISTEN_ERR,
    CONNECT_ERR,
    FORK_ERR,
    ACCEPT_ERR,
    OPEN_ERR
};

// 模版：不被拷贝，复制

class NoCopy
{
public:
    NoCopy()
    {}
    ~NoCopy()
    {}
    NoCopy(const NoCopy &) = delete;

    const NoCopy &operator=(const NoCopy &) = delete;
};

// 模版: stuct socketaddr_in -> sockaddr* 用于接收与发送
#define CONV(addr) ((struct sockaddr *)&addr)